{include file="common/header.tpl"}
{if $AppUI->id <= 0}
	{include file="index/login.tpl"}  
{else}
	{include file="common/menu.tpl"}
    <div class="rightColumn">
    	<div class="boxContent">
        	<div class="contentItem">
                <div class="contentItems">
                	<div class="headerTitle"><h2><a href="{if isset($smarty.session.cpost.prefer)}{$smarty.session.cpost.prefer}{else}{$refer}{/if}">Danh mục sản phẩm</a> &raquo; Thêm mới</h2></div>
                    <div class="secData">
                    	<form name="frmAdd" id="frmAdd" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}category/save">
                        	 <input type="hidden" name="prefer" id="prefer" value="{if isset($smarty.session.cpost.prefer)}{$smarty.session.cpost.prefer}{else}{$refer}{/if}" />
                        	{if isset($smarty.session.cerror)}
                            	<div class="userInput">
                                	<span class="errorMessage">{$smarty.session.cerror}</span>
                                </div>
                            {/if}
                        	{if $intParentId > 0}
                                <div class="userInput">
                                    <label for="pparentid">Danh mục cấp 1:</label>
                                    <select name="pparentid" id="pparentid">
                                    	<option value="">--Chọn--</option>
                                        {if isset($smarty.session.cpost.pparentid)}
	                                        {html_options options=$arrParent selected=$smarty.session.cpost.pparentid}
                                        {else}
                                        	{html_options options=$arrParent}
                                        {/if}
                                    </select>
                                </div>
                            {/if}
                        	<div class="userInput">
                            	<label for="pname">Tên <span class="symbolRequired">*</span>:</label>
                                <input type="text" class="text" name="pname" id="pname" value="{if isset($smarty.session.cpost.pname)}{$smarty.session.cpost.pname}{/if}" maxlength="255" />
                            </div>
                            <div class="userInput">
                            	<label for="pdisorder">Trình tự hiển thị:</label>
                                <input type="text" class="text" name="pdisorder" id="pdisorder" value="{if isset($smarty.session.cpost.pdisorder)}{$smarty.session.cpost.pdisorder}{/if}" onkeypress="javascript: return isNumberKey(event);"/>
                            </div>
                            <div class="secAction">
                        		<input type="submit" value="Lưu dữ liệu"/>
                               	<input type="reset" value="Nhập lại"/>
                            </div>
                        </form>
                   	</div>
                </div>
          	</div>
        </div>
    </div>
{/if}
{include file="common/footer.tpl"}
                
